// pages/component/settingItem/settingItem.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    region:{
      type:Object,
      value:undefined
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    currentIndex:0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    //swiper切换时会调用
    pagechange: function (e) {
      if ("touch" === e.detail.source) {
        let currentPageIndex = this.data.currentIndex;
        currentPageIndex = (currentPageIndex + 1) % 2;
        this.setData({
          currentIndex: currentPageIndex
        });
      }
    },
    titleClick: function (e) {
      let currentPageIndex =
        this.setData({
          //拿到当前索引并动态改变
          currentIndex: e.currentTarget.dataset.idx
        });
    },
  },
  lifetimes: {
    ready: function () {
      // var _this=this;
      // console.log("region = " + JSON.stringify(_this.data.region));
    }
  }
})
